package com.example.myandroidapp1;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.example.myandroidapp1.activity.AbstractBaseActivity;

public class MainActivity extends AbstractBaseActivity {

	private TextView tvDisplay;
	private Button bAdd;
	private Button bSub;
	private int counter;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		tvDisplay = (TextView) findViewById(R.id.tvDisplay);
		bAdd = (Button) findViewById(R.id.bAdd);
		bSub = (Button) findViewById(R.id.bSub);
		counter = 0;
		bAdd.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				tvDisplay.setText("Your Total is "+ ++counter);
			}
			
		});
		bSub.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				tvDisplay.setText("Your Total is "+ --counter);
			}
			
		});
		
	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
	}
	
	@Override
	protected void onPause() {
		super.onPause();
		//finish();
	}
}
